<?php $this->load->view('config/header');?>
<h2>Form <?php echo $mode?></h2>
<div class="line-separtor"></div>
<br/>	
	<a href="<?php echo site_url()?>imagecontent" class="btn btn-primary"> Kembali ke daftar </a>
<br/>
<br/>
<form method="post" action="<?php echo site_url() ?>imagecontent/<?php echo $action; ?>" class="form-horizontal" enctype="multipart/form-data">
	<input type="hidden" name="id_image" value="<?php echo @$detail[0]['id_image']?>">
	<input type="hidden" name="image_content_tmp" value="<?php echo @$detail[0]['image_content']?>" />
	
	<div class="control-group">
		<label class="control-label" for="type_image">Type image</label>
		<div class="controls">
			<?php $selected1 =  '' ?>
			<?php $selected2 =  '' ?>
			<?php $selected3 =  '' ?>
			<select name="type_image">
				<?php if (@$detail[0]['type_image'] == 1):?>
					<?php $selected1 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_image'] == 2) :?>
					<?php $selected2 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_image'] == 3) :?>
					<?php $selected3 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_image'] == 4) :?>
					<?php $selected3 =  'selected="selected"' ?>
				<?php else:?>
					<?php $selected1 =  '' ?>
					<?php $selected2 =  '' ?>
					<?php $selected3 =  '' ?>
				<?php endif;?>
				
				<option value="1" <?php echo $selected1 ?> >Logo</option>
				<option value="2" <?php echo $selected2 ?> >Slideshow</option>
				<option value="3" <?php echo $selected3 ?> >Sponsor</option>
			</select>
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label" for="image_content">Upload picture</label>
		<div class="controls">
			<?php if(@$detail[0]['image_content'] == "" ):?>
				<input type="file" name="image_content" value="<?php echo @$detail[0]['image_content']?>" ></input>
			<?php else:?>
				<input type="text" name="image_content" class="span7" value="<?php echo @$detail[0]['image_content']?>" readonly="readonly"/>
			<?php endif;?>
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label" for="keterangan">Deskripsi gambar</label>
		<div class="controls">
			<input type="text" class="span8" name="deskripsi_gambar" value="<?php echo @$detail[0]['deskripsi_gambar']?>" >
		</div>
	</div>
	
	<div class="form-actions">
		<input type="submit" name="submit" value="Simpan" class="btn btn-primary"/>
		<a href="<?php echo site_url()?>imagecontent" class="btn">Batal</a>
	</div>
</form>
<?php $this->load->view('config/footer');?>